package davidlauzon.activerecord.nodes;

import java.util.Map;

import davidlauzon.activerecord.nodes.field.Field;
import davidlauzon.activerecord.visitor.SqlSerializer;

public class UpdateStatement extends SqlStatement
{
    /*********************************************************************************************
     * VARIABLES
     *********************************************************************************************/
    private Table              _table;
    private WhereClause        _where;
    private Map<Field, Object> _values;
    
    
    /*********************************************************************************************
     * SIMPLE GETTER & SETTERS
     *********************************************************************************************/
    public Table             getTable()       { return _table; }
    public Map<Field,Object> getValues()      { return _values; }
    public WhereClause       getWhereClause() { return _where; }
    
    
    
    /*********************************************************************************************
     * PUBLIC METHODS
     *********************************************************************************************/
    public UpdateStatement() {
        super();
    }
    
    public void setTable(Table table) {
        _table = table;
    }
    
    public void setWhereClause(WhereClause where) {
        _where = where;
    }
    
    public void setValues(Map<Field, Object> values) {
        _values = values;
    }

    @Override
    public String accept(SqlSerializer visitor) {
        return visitor.visit( this );
    }
}
